package dao.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ShoppingCart entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "shopping_cart", catalog = "onlinemall")
public class ShoppingCart implements java.io.Serializable {

	// Fields

	private Integer shoppingCartId;
	private MemberInfo memberInfo;
	private ShelfCommodityInfo shelfCommodityInfo;
	private Integer number;

	// Constructors

	/** default constructor */
	public ShoppingCart() {
	}

	/** full constructor */
	public ShoppingCart(Integer shoppingCartId, MemberInfo memberInfo,
			ShelfCommodityInfo shelfCommodityInfo, Integer number) {
		this.shoppingCartId = shoppingCartId;
		this.memberInfo = memberInfo;
		this.shelfCommodityInfo = shelfCommodityInfo;
		this.number = number;
	}

	// Property accessors
	@Id
	@Column(name = "shopping_cart_id", unique = true, nullable = false)
	public Integer getShoppingCartId() {
		return this.shoppingCartId;
	}

	public void setShoppingCartId(Integer shoppingCartId) {
		this.shoppingCartId = shoppingCartId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "member_id", nullable = false)
	public MemberInfo getMemberInfo() {
		return this.memberInfo;
	}

	public void setMemberInfo(MemberInfo memberInfo) {
		this.memberInfo = memberInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shelf_commodity_id", nullable = false)
	public ShelfCommodityInfo getShelfCommodityInfo() {
		return this.shelfCommodityInfo;
	}

	public void setShelfCommodityInfo(ShelfCommodityInfo shelfCommodityInfo) {
		this.shelfCommodityInfo = shelfCommodityInfo;
	}

	@Column(name = "number", nullable = false)
	public Integer getNumber() {
		return this.number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

}